#!/usr/bin/python

import datetime as dt
import os
import shutil as sh
import subprocess as sbp
from utils import current_timestamp

timestamp = current_timestamp()

#create directories to keep output organized
#high-level directory == timestamp
os.makedirs(timestamp+'/'+'output') #useless directory
os.mkdir(timestamp+'/'+'error') #useless directory
os.mkdir(timestamp+'/'+'pickled_output') #useful directory
os.mkdir(timestamp+'/'+'output_arrays') #useful directory

#copy in a bunch of files

#job_script='jobscript.sh'
job_script='q_jobscript.sh'

sh.copy(job_script,timestamp)
sh.copy('get_trajectory.py',timestamp)
sh.copy('trajectory_input_file',timestamp)

#go to timestamp directory
os.chdir(timestamp)

#run job
#engine = 'bsub'
engine = ['qsub', '-cwd']

#print os.getcwd()
